<?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
	<table bordercolor="#006600" border="1px">
    	<tr>
        	<th>วันที่</th>
            <th>น้ำหนัก</th>
            <th>รายละเอียดเพิ่มเติม</th>
        </tr>
<?php
	require('config.ini.php');
	$ryear = $_GET["ryear"]-543;
	$rmonth = $_GET["rmonth"];
	$ruser = $_SESSION['userid'];
	$sql = "SELECT * FROM `reportweight` WHERE year( reportdate ) = '$ryear' AND month( reportdate ) = '$rmonth' AND userid = '$ruser'";
	$result = mysql_query($sql);
	while($row = mysql_fetch_array($result)){
	?>
    	<tr>
        	<td><?php echo $row["1"]; ?></td>
            <td><?php echo $row["2"]; ?></td>
            <td><?php echo $row["3"]; ?></td>
        </tr>
    <?php
	}
	mysql_free_result($result);
	mysql_close($link);
?>
	</table>
</body>
</html>
